package com.tiantian.quanminxiu.api;

import okhttp3.ResponseBody;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;

//汇付宝服务器
public interface HeePayService {

    class Factory {
        public static HeePayService create() {
            Retrofit retrofit = new Retrofit.Builder()
                    .baseUrl("https://pay.heepay.com/Phone/")
                    .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                    .build();
            return retrofit.create(HeePayService.class);
        }
    }

    //region 汇付宝支付请求 response
    @FormUrlEncoded
    @POST("SDK/PayInit.aspx")
    Observable<ResponseBody> PayInit(@Field("version")String version,@Field("pay_type")String pay_type,@Field("agent_id")String agent_id,
                                     @Field("agent_bill_id")String agent_bill_id,@Field("pay_amt")String pay_amt,@Field("return_url")String return_url,
                                     @Field("notify_url")String notify_url,@Field("user_ip")String user_ip,@Field("agent_bill_time")String agent_bill_time,
                                     @Field("goods_name")String goods_name,@Field("goods_num")String goods_num,@Field("remark")String remark,
                                     @Field("goods_note")String goods_note,@Field("sign")String sign);
    //endregion
}
